<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,  initial-scale=1.0">
<title>我的文章</title>
<script type="text/javascript"  src="/resource/js/jquery-3.2.1.js"></script>
<script type="text/javascript"  src="/resource/js/bootstrap.js"></script>
<link rel="stylesheet" href="/resource/css/bootstrap.css">
<style type="text/css">
     img {
           max-width: 450px;
     }
     a:visited {
      color: #000000;
      text-decoration: none;
     }
     a:linked {
      color: #000000;
      text-decoration: none;
     }
     
</style>
</head>
<body>
	<div class="container">
		 <ul class="list-unstyled">
           <c:forEach items="${info.list}" var="c">
                <li class="media">
                      
                      <a href="${c.url }">
                           ${c.text }

                           收藏时间：<fmt:formatDate  value="${c.created}" pattern="yyyy-MM-dd HH:mm:ss"/>
                      </a>
                           <input type="button"  onclick="del(${c.id})" value="删除"  class="btn btn-sm btn-info">
                      
                </li>
                <hr>
           </c:forEach>
     	</ul>
     	<jsp:include  page="/WEB-INF/view/common/pages.jsp"></jsp:include>
	</div>
</body>

<script type="text/javascript">
//分页的方法
function goPage(pageNum){
      /* location="/my/articles?pageNum="+pageNum; */
      
      //直接在中央展示区，加载数据
      $("#center").load("${pageContext.request.contextPath }/my/collect?pageNum="+pageNum);
}

//删除
function del(id){
      //调用ajax从后台删除数据
      $.post(
           "${pageContext.request.contextPath }/my/delCollect",
           {id:id},
           function(result){
                 if(result){
                      window.location.reload();
                 }
           }
      )
      
}
</script>

</html>